const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = {
    mode:'development',
    entry: {
        xixi:'./src/index.js',
        // hehe:'./src/a.js'//出口的key值为hehe,路径
    },
    output: {
        
        path: path.resolve(__dirname, 'hei'),//出口文件夹绝对路径
        filename:'[name]_[hash].js'
            //  'hehe.js'//出口文件名
      },
      module: {
        rules: [
          {
            test: /\.css$/,
            use: [
              'style-loader',
              'css-loader'
            ]
          },
         {
           test: /\.(png|svg|jpg|gif)$/,
         use: [
            'file-loader'
         ]
      }
        ]
      },
      //根据现有的html文件添加数据进去后拷贝新的一份。
      plugins: [new HtmlWebpackPlugin({  
        title: '新生成的',
        filename: 'assets/admin.html',//最终生成的html路径为出口路径加上此路径
        template: './dist/0407.html'//目标html的模板
      })]

  }